import 'dart:convert';

import 'package:safetymonitor/app/data/common/choice_bean.dart';
import 'package:safetymonitor/generated/json/base/json_field.dart';
import 'package:safetymonitor/generated/json/user_resp_entity.g.dart';
export 'package:safetymonitor/generated/json/user_resp_entity.g.dart';

@JsonSerializable()
class UserRespEntity extends ChoiceBean {
  UserRespEntity();

  factory UserRespEntity.fromJson(Map<String, dynamic> json) => $UserRespEntityFromJson(json);
  late int id = 0;

  ///	用户账号
  late String username = '';

  ///	用户昵称
  late String nickname = '';

  ///	备注
  late String remark = '';

  ///	部门ID
  late int deptId = 0;

  ///	部门名称
  late String deptName = '';

  ///	岗位编号数组
  late int postIds = 0;

  ///	用户邮箱
  late String email = '';

  ///	手机号码
  late String mobile = '';

  ///	用户性别，参见 SexEnum 枚举类
  late int sex = 0;

  ///	用户头像
  late String avatar = '';

  ///	状态，参见 CommonStatusEnum 枚举类
  late int status = 0;

  ///	最后登录 IP
  late String loginIp = '';

  ///	最后登录时间
  late String loginDate = '';

  ///	创建时间
  late String createTime = '';

  Map<String, dynamic> toJson() => $UserRespEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id.toString();
  }

  @override
  String getShowName() {
    return nickname;
  }
}
